<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->params['static'].'assets/js/bootbox.min.js',2); ?>
<div class="page-header">
							<h1>
						    所有问卷
							</h1>
</div>
<div class="row">
  <div class="col-xs-12">
     <div class="row">
						<div class="widget-box">
						<div class="widget-header widget-header-small">
								<h5 class="lighter">问卷</h5>
						</div>

						<div class="widget-body">
								<div class="widget-main">
							<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														
														<th>调查问卷名称</th>
														<th>描述</th>
														<th>已参加人数</th>
														<th>题目数目</th>
														<th>状态</th>
														
														
														<th>
															<i class="icon-time bigger-110"></i>
															添加时间
														</th>
														
														<th>查看统计</th>
													</tr>
												</thead>

												<tbody>
												<?php
												  foreach($surs as $s){
													 echo '
													<tr>
														<td>
															<a href="#">'.$s->name.'</a>
														</td>
														
														
														
														<td>
														 <span display-detail-id="'.$s->surveyId.'" style="display:none;">'.$s->detail.'</span>
															<button class="btn btn-sm btn-info" detail-id="'.$s->surveyId.'">
																详情
															</button>
														</td>
														<td>'.$s->attendnum.'</td>
														<td>'.$s->questionnum.'</td>
														<td>
															<span class="label label-sm label-success"><i class="icon-spinner"></i>&nbsp已发布</span>
														</td>
														<td>'.$s->addtime.'</td>
														

														
														<td>
															<div >
												               <a target="_blank" href="'.Yii::app()->CreateUrl('survey/surveyprofile',array('surveyId'=>$s->surveyId)).'">
															   <button class="btn btn-xs btn-warning" data-rel= "tooltip" data-original-title = "查看统计">
																	<i class="icon-bar-chart bigger-120"></i>
																</button>
                                                                </a>
																
															</div>

														</td>
													</tr>';
												  }
                                                   ?>
												</tbody>
											</table>
										</div><!-- /.table-responsive -->
									</div>	
								</div>	
						</div>	

					</div>
			</div>
</div>
<script type="text/javascript">
 jQuery(function($){
	 
	  
	    $('[detail-id]').on("click",function(){
			var id = $(this).attr('detail-id');
			bootbox.alert($("[display-detail-id = "+id+"]").html(),function(){
				
				
			});

		  
		   
	   });
	 
 })
</script>
